3.1.5 \(\int \csc (x) (a \cos (x)+b \sin (x)) \, dx\) [5]

Optimal. Leaf size=9 \[ b x+a \log (\sin (x)) \]

[Out]

b*x+a*ln(sin(x))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 9, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3164, 3556} \begin {gather*} a \log (\sin (x))+b x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[x]*(a*Cos[x] + b*Sin[x]),x]

[Out]

b*x + a*Log[Sin[x]]

Rule 3164

Int[sin[(c_.) + (d_.)*(x_)]^(m_)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Symb
ol] :> Int[(b + a*Cot[c + d*x])^n, x] /; FreeQ[{a, b, c, d}, x] && EqQ[m + n, 0] && IntegerQ[n] && NeQ[a^2 + b
^2, 0]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \csc (x) (a \cos (x)+b \sin (x)) \, dx &=\int (b+a \cot (x)) \, dx\\ &=b x+a \int \cot (x) \, dx\\ &=b x+a \log (\sin (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 9, normalized size = 1.00 \begin {gather*} b x+a \log (\sin (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]*(a*Cos[x] + b*Sin[x]),x]

[Out]

b*x + a*Log[Sin[x]]

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 10, normalized size = 1.11

method result size
default \(b x +a \ln \left (\sin \left (x \right )\right )\) \(10\)
risch \(b x -i a x +a \ln \left ({\mathrm e}^{2 i x}-1\right )\) \(20\)
norman \(\frac {b x +b x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{1+\tan ^{2}\left (\frac {x}{2}\right )}+a \ln \left (\tan \left (\frac {x}{2}\right )\right )-a \ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )\) \(45\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)*(a*cos(x)+b*sin(x)),x,method=_RETURNVERBOSE)

[Out]

b*x+a*ln(sin(x))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 9, normalized size = 1.00 \begin {gather*} b x + a \log \left (\sin \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x, algorithm="maxima")

[Out]

b*x + a*log(sin(x))

________________________________________________________________________________________

Fricas [A]
time = 3.26, size = 11, normalized size = 1.22 \begin {gather*} b x + a \log \left (\frac {1}{2} \, \sin \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x, algorithm="fricas")

[Out]

b*x + a*log(1/2*sin(x))

________________________________________________________________________________________

Sympy [A]
time = 0.66, size = 8, normalized size = 0.89 \begin {gather*} a \log {\left (\sin {\left (x \right )} \right )} + b x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x)

[Out]

a*log(sin(x)) + b*x

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 24 vs. \(2 (9) = 18\).
time = 0.43, size = 24, normalized size = 2.67 \begin {gather*} b x - a \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right ) + a \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x, algorithm="giac")

[Out]

b*x - a*log(tan(1/2*x)^2 + 1) + a*log(abs(tan(1/2*x)))

________________________________________________________________________________________

Mupad [B]
time = 0.54, size = 54, normalized size = 6.00 \begin {gather*} a\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-a\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}\right )-a\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1{}\mathrm {i}\right )-b\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}\right )\,1{}\mathrm {i}+b\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1{}\mathrm {i}\right )\,1{}\mathrm {i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cos(x) + b*sin(x))/sin(x),x)

[Out]

a*log(tan(x/2)) - a*log(tan(x/2) - 1i) - a*log(tan(x/2) + 1i) - b*log(tan(x/2) - 1i)*1i + b*log(tan(x/2) + 1i)
*1i

________________________________________________________________________________________